package tech.heptagram.staff.model.enums;


import tech.heptagram.staff.exception.EnumParseException;

public enum JobTypeEnum {
    CREATE_USER(1,"创建钉钉用户"),
    UPDATE_USER(2,"更新钉钉用户"),
    DELETE_USER(3,"删除钉钉用户"),
    CREATE_DEPARTMENT(4,"创建钉钉部门"),
    UPDATE_DEPARTMENT(5,"更新钉钉部门"),
    DELETE_DEPARTMENT(6,"删除钉钉部门"),
    CHECK_DING_AND_LOCAL(7,"检查钉钉与本地数据是否一致"),
    PULL_INFORMATION(8,"拉取签到与打卡数据");

    private int value;
    private String desc;

    JobTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }

    public static JobTypeEnum valueOf(int value) {
        for (JobTypeEnum jobTypeEnum : JobTypeEnum.values()) {
            if (jobTypeEnum.getValue() == value) {
                return jobTypeEnum;
            }
        }
        throw new EnumParseException(JobTypeEnum.class, String.valueOf(value));
    }
}
